<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    var regex1 = /abcd/;
    let result01 = regex1.test("abcde");//true 因为js正则默认是模糊匹配
    console.log(result01);

    console.log("==========");

    /*
       ^:代表的是以啥开头
       $:代表的是以啥结尾
     */
    var regex2 = /^abcd$/;
    let result02 = regex2.test("abcde");
    console.log(result02);
</script>

</html>